-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
worker/server: update metrics on requeue #4461
base: main
Are you sure you want to change the base?
Conversation
241e9e5
to
4340f1e
Compare
When requeuing a job the next worker requesting the job would decrement pending counter, but the pending counter only ever got incremented once, when the job was first enqueued. Thus make sure to increment the pending counter when a job is requeued.
4340f1e
to
2d0f3bd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, There is no explicit test for the metrics right?
Not sure if this is doable with a sane effort.
And might be a separate PR?
if requeued { | ||
jobInfo, err := s.jobInfo(jobId, nil) | ||
if err != nil { | ||
return fmt.Errorf("error requeueing job: %w", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more like error getting job details for prometheus metrics
should we skip prometheus metrics here and try to continue, rather than fail?
although this will then probably fail some lines below…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's very unlikely that this call will fail if the job exists.
It's definitely possible to add unit tests, I'll do that. |
Sidenote - I think the |
worker/server: update metrics on requeue